Re: [SQL] How To Use JOIN?

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [SQL] How To Use JOIN?
Дата
Msg-id l03110707b277562a7e9b@[147.233.159.109]
обсуждение исходный текст
Ответ на How To Use JOIN?  (Takashi Tokunaga <taka-tok@chaos.digital-magic.co.jp>)
Список pgsql-sql
At 18:05 +0200 on 17/11/98, Takashi Tokunaga wrote:


> 3. Now after that worked without any problem, so I now create SELECT
>    statement:
>
>   select * from test1 test2 where code_1 = test.code_2 \g
>   ERROR:  attribute 'code_2' not found
>
> nope that didn't work
>
>   select test1.name_1 from test1 test2 where test1.code_1 = test2.code_2 \g
>   ERROR:  attribute 'code_2' not found

You seem to have forgotten a comma...

SELECT *
FROM test1, test2   <---- Here
WHERE code1 = code2;

if you don't put a comma, "test2" will be used as an alias to "test1", not
as a table on its own.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



В списке pgsql-sql по дате отправления:

Предыдущее
От: Takashi Tokunaga
Дата:
Сообщение: How To Use JOIN?
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: [SQL] How To Use JOIN?